package com.song.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RedisController {
    @Autowired
    private RedisTemplate<Object, Object> masterRedisTemplate;

    @PostMapping("/masterSet")
    public void masterSet(String key, String value){
        masterRedisTemplate.opsForValue().set(key, value);
    }

    @GetMapping("/masterGet")
    public Object masterGet(String key){
        return masterRedisTemplate.opsForValue().get(key);
    }
}
